package com.codeduck.validate.entity;

import com.codeduck.validate.groups.Groups;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * 分组校验：某个属性归属于某个分组时，才进行校验
 *
 * @author: <a href="mailto:codeduck@163.com">Codeduck</a>
 * @createDate: 2021-12-26
 */
public class User {

    @NotBlank(message = "id 不能为空", groups = Groups.Update.class)
    private String id;

    @NotBlank(message = "name 不允许为空", groups = Groups.Default.class)
    private String name;

    @NotBlank(message = "email 不允许为空", groups = Groups.Default.class)
    private String email;
}
